<?php 
$last=$pageInfo['beginPage']-((int)($pageInfo['PageHtmlLen'])/2)-1;
$next=$pageInfo['endPage']+((int)($pageInfo['PageHtmlLen'])/2)+1;
 ?>

<div class="pageNav">
	<li><a ref="nofollow" title="第一页" href="<?php echo $pageInfo['mainUrl'].'1'.$pageInfo['ext']; ?>">第1页</a></li>
	
	<?php if ($last>0){ ?>
	<li><a ref="nofollow" title="上<?php echo $pageInfo['PageHtmlLen']; ?>页" href="<?php echo $pageInfo['mainUrl'].$last.$pageInfo['ext']; ?>">&lt;</a></li>
	<?php } ?>
		
	<?php for ($i=$pageInfo['beginPage'];$i<=$pageInfo['endPage'];$i++) { ?>
		<?php if ($i>$pageInfo['totalPage']){ ?>
		<?php }else{ ?>
			<?php if ($i==$pageInfo['currentPage']){ ?>
				<li><span  class='navSelected'><em><?php echo $pageInfo['currentPage']; ?></em></span></li>
			<?php }else{ ?>
				<li><a ref="nofollow" href="<?php echo $pageInfo['mainUrl'].$i.$pageInfo['ext']; ?>"><?php echo $i; ?></a></li>  
			<?php } ?>
		<?php } ?>
	<?php } ?>
		
	<?php if ($next<$pageInfo['totalPage']){ ?>
	<li><a ref="nofollow" title="下<?php echo $pageInfo['PageHtmlLen']; ?>页" href="<?php echo $pageInfo['mainUrl'].$next.$pageInfo['ext']; ?>">&gt</a></li>
	<?php } ?>
	
	<?php if ($pageInfo['totalPage']>$pageInfo['PageHtmlLen']){ ?>
	<li><a ref="nofollow" title="末页" href="<?php echo $pageInfo['mainUrl'].$pageInfo['totalPage'].$pageInfo['ext']; ?>">末页</a></li>
	<?php } ?>

</div>
